﻿// TestClass.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include "..\TestDll\TestClass.h"
using namespace std;
void TestHouse()
{
    House h1;
    Father f1;
    h1.person1 = f1;
    House h11(h1);
    std::cout << "h1:" << (int)&h1 << endl;
    std::cout << "f1:" << (int)&f1 << endl;
    std::cout << "p1:" << (int)&(h1.person1) << endl;
    std::cout << "h11:" << (int)&h11 << endl;
    std::cout << "p11:" << (int)&(h11.person1) << endl;

    House* h2=new House();
    Father* f2= new Father();
    h2->person1 = *f2;
    House* h22 = new House(h1);

    std::cout << "h2:" << (int)h2 << endl;
    std::cout << "h22:" << (int)h22 << endl;
    std::cout << "f2:" << (int)f2 << endl;
    std::cout << "p2:" << (int)&(h2->person1) << endl;
    std::cout << "p22:" << (int)&(h22->person1) << endl;

    House* h3 = new House();
    Son son;
    h3->person1 = son;
    std::cout << "h3:" << (int)h3 <<";size"<<sizeof(&h3)<< endl;
    std::cout << "son:" << (int)&son << ";size" << sizeof(son) << endl;
    std::cout << "son2:" << (int)&(h3->person1) << ";size" << sizeof(&h3) << endl;

}
void TestStru()
{
    Houses* hs = new Houses();
    Ship* shp = new Ship();
    Houses sd;
    Ship kd;

    std::cout << "hs:" << (int)&sd << ";size:" << sizeof(sd) << endl;

    std::cout << "shp:" << (int)&kd << ";size:" << sizeof(&kd) << endl;

}
int main()
{
    TestStru();
    //TestHouse();
    /*House* h2 = new House();
    delete h2;*/
    std::cout << "Hello World!\n";
}

// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单

// 入门使用技巧: 
//   1. 使用解决方案资源管理器窗口添加/管理文件
//   2. 使用团队资源管理器窗口连接到源代码管理
//   3. 使用输出窗口查看生成输出和其他消息
//   4. 使用错误列表窗口查看错误
//   5. 转到“项目”>“添加新项”以创建新的代码文件，或转到“项目”>“添加现有项”以将现有代码文件添加到项目
//   6. 将来，若要再次打开此项目，请转到“文件”>“打开”>“项目”并选择 .sln 文件
